
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%-- 导入面包屑 --%>
<jsp:include page="../common/nav.jsp"></jsp:include>

<div class="wrapper wrapper-content animated fadeInRight">

    <%-- 导入提示信息框 --%>
    <c:if test="${hint!=null&&hint!=''}">
   		<jsp:include page="../common/alert/alert.jsp">
   			<jsp:param value="${hint}" name="alertType"/>
   			<jsp:param value="${alertMessage}" name="alertMessage"/>
   		</jsp:include>
    </c:if>
	
	<%-- 导入查询框 --%>
	<jsp:include page="search/poaArchivedSearch.jsp"></jsp:include>
	
	<div class="row">
		<div class="col-lg-12">
			<div class="ibox ">
		        <div class="ibox-title">
		            <h4>合同归档列表</h4>
		            <div class="ibox-tools">
		                <button id="searchButton" class="btn btn-default btn-sm btn-notcontrol" type="button"><i class="fa fa-search"></i>&nbsp;&nbsp;展开查询</button>
		            	<button id="exportListButton" class="btn btn-sm btn-notcontrol" type="button"><i class="fa fa-download"></i>&nbsp;&nbsp;导出表格</button>
		            </div>
		        </div>
				<div class="ibox-content border-bottom" style="padding-bottom: 0px;">
					<div class="table-responsive">
						<table class="table table-striped table-hover table-bordered border-top">
							<thead>
								<tr>
									<%--
									<th></th>
									--%>
									<th width="5%">序号</th>
									<th width="10%">合同编码</th>
									<th width="5%">合同单号</th>
									<th width="10%">合同名称</th>
									<th width="7%">站点名称</th>
									<th width="10%">乙方名称</th>
									<th width="6%">合同金额</th>
									<th width="7%">合同进度</th>
									<th width="5%">合同性质</th>
									<th width="5%">合同类型</th>
									<th width="7%">合同签订日期</th>
									<th width="8%">创建时间</th>
									<th width="5%">状态</th>
									<th width="5%">审批状态</th>
									<th width="10%">操作</th>
								</tr>
							</thead>
							<tbody>
							
							    <c:forEach items="${requestScope.poHeadList}" var="data" varStatus="status">
								<tr>
									<%--
									<td><input type="checkbox" class="i-checks"
										name="input[]"></td>
									--%>
									<td>${status.count}</td>
									<td>${data.poHeadCode}</td>
									<td>${data.projectCode}</td>
									<td>${data.poName}</td>
									<td>${data.orgCode}</td>
									<td>${requestScope.vendorMap[data.staffCode]}</td>
									<td>${data.poaAmount}</td>
									<td>合同进度</td>
									<td>${requestScope.poQualeMap[data.taxType]}</td>
									<td>${requestScope.poTypeMap[data.poType]}</td>
									<td><fmt:formatDate value="${data.startDate}" pattern="yyyy-MM-dd"/></td>
									<td><fmt:formatDate value="${data.createdDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
									<td>
									<c:choose>
									   <c:when test="${data.status=='NEW'}">
									       <span class="label label-primary">${requestScope.poStatusMap[data.status]}</span>
									   </c:when>
									   <c:when test="${data.status=='CONFIRM'}">
									       <span class="label label-success">${requestScope.poStatusMap[data.status]}</span>
									   </c:when>
									   <c:when test="${data.status=='ALTER'}">
										   <span class="label label-success">${requestScope.poStatusMap[data.status]}</span>
									   </c:when>
									   <c:when test="${data.status=='FINISH'}">
										   <span class="label label-success">${requestScope.poStatusMap[data.status]}</span>
									   </c:when>
									   <c:otherwise>
									       <span class="label label-danger">${requestScope.poStatusMap[data.status]}</span>
									   </c:otherwise>
									</c:choose>
									</td>
									<td>
									<c:choose>
									   <c:when test="${data.approveStatus=='UNSUBMIT'}">
									       <span class="label">${requestScope.approveStatusMap[data.approveStatus]}</span>
									   </c:when>
									   <c:when test="${data.approveStatus=='SUBMIT'}">
									       <span class="label label-info">${requestScope.approveStatusMap[data.approveStatus]}</span>
									   </c:when>
									   <c:when test="${data.approveStatus=='APPROVE'}">
									       <span class="label label-primary">${requestScope.approveStatusMap[data.approveStatus]}</span>
									   </c:when>
									   <c:when test="${data.approveStatus=='REJECT'}">
									       <span class="label label-warning">${requestScope.approveStatusMap[data.approveStatus]}</span>
									   </c:when>
									   <c:otherwise>
										   <span class="label label-success">${requestScope.approveStatusMap[data.approveStatus]}</span>
									   </c:otherwise>
									</c:choose>
									</td>
									<td>
										<div class="btn-group">
											<c:if test="${data.status=='CONFIRM'}">
												<button class="btn-white btn btn-xs btn-notcontrol" onclick="editData('${data.poHeadCode}')"><i class="fa fa-edit"></i>&nbsp;归档</button>
											</c:if>
											<button class="btn-white btn btn-xs btn-notcontrol" onclick="viewData('${data.poHeadCode}')"><i class="fa fa-edit"></i> 查看</button>
										</div>
									</td>
								</tr>
								</c:forEach>
								
							</tbody>
							<tfoot>
							    <%-- 导入页码 --%>
								<jsp:include page="../common/pages.jsp"></jsp:include>
							</tfoot>
						</table>
					</div>

				</div>
			</div>
		</div>
		
	</div>
</div>

<!-- listPage -->
<script src="js/listPage.js"></script>
<script>
	
	function editData(code){
		window.location.href="web/poAgreementHeadArchived/getPoHeadArchived?poHeadCode="+code;
	}

	function viewData(code){
		window.location.href="web/poAgreementHeadArchived/getPoHeadArchivedView?poHeadCode="+code;
	}

</script>       